import axiosServer from "@/utils/request";


/**
 * 攻略新增（后台）
 * @param strategyType 攻略分类
 * @param careerType 职业分类
 * @param title title
 * @param content content
 * @param upper 上线
 * @param pictureListData  图片集合
 * @returns {Promise<AxiosResponse<any>> | *}
 */
export const strategyAdd = (strategyType, careerType, title, content, upper, pictureListData) => {
    return axiosServer({
        method: "post",
        url: "/strategy/add",
        data: { strategyType, careerType, title, content, upper, pictureListData }
    });
}
/**
 * 修改是否上线（后台）
 * @param id
 * @param upper
 * @returns {*}
 */
export const strategyUpdateUpper = (id, upper) => {
    return axiosServer({
        method: "post",
        url: "/strategy/add",
        params: { id, upper }
    });
}
/**
 * 攻略删除（后台）
 * @param id
 * @returns {*}
 */
export const strategyDelete = (id) => {
    return axiosServer({
        method: "delete",
        url: "/strategy/delete/" + id,
    });
}
/**
 * 攻略列表数据（后台）
 * @param upper 是否上线
 * @param strategyType 攻略分类
 * @param careerType 职业分类
 * @param title 标题
 * @param page
 * @param limit
 * @returns {*}
 */
export const strategyListData = (upper, strategyType, careerType, title, page, limit) => {
    return axiosServer({
        method: "get",
        url: "/strategy/listData",
        params: { upper, strategyType, careerType, title, page, limit }
    });
}
/**
 * 攻略详情（后台）
 * @param id
 * @returns {*}
 */
export const strategyLoadById = (id) => {
    return axiosServer({
        method: "get",
        url: "/strategy/loadById/" + id,
    });
}
